<li class="list-unstyled">
{% for (user_id, nickname, type_level_code), value in team_tree.items() recursive %}
    {% if loop.first %}
        <ul>
    {% endif %}
        <li class="list-unstyled">
            <a href="javascript:void(0);">{{ nickname }} [{{ user_id }}] [{{ type_level_code | type_level }}]</a>
        </li>
    {% if value %}
        {{ loop(value.items()) }}
    {% endif %}
    {% if loop.last %}
        </ul>
    {% endif %}
{% endfor %}
</li>